<!-- 样式 -->
<script type="text/html" template>
    <link rel="stylesheet" href="{{ layui.setter.base }}style/css/reset.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style/css/home/datailed.css">
</script>
<div class="layui-card layadmin-header">
    <div class="layui-breadcrumb" lay-filter="breadcrumb">
        <a>首页</a>
        <a><cite>设备信息详细信息</cite></a>
    </div>
</div>
<div class="layui-containner">
    <div class="layui-fluid">
        <div id="view-one"></div>
        <div class="layui-tab">
            <ul class="tab layui-tab-title">
                <li class="layui-this">相关工单</li>
                <li>状态变更记录</li>
                <li>相关文档</li>
                <li>关联备品备件</li>
                <li>备品备件消耗记录</li>
                <li>信息变更记录</li>
                <li>设备履历</li>
                <li>Scada</li>
                <li>请采购记录</li>
                <li>设备参数</li>
            </ul>
            <div class="layui-tab-content">
                <!-- 相关工单 -->
                <div class="layui-tab-item layui-show">
                    <div class="icon-box layui-btn-containner">
                        <div class="export-icon icon"></div>
                        <div class="stamp-icon icon"></div>
                    </div>
                    <table class="layui-table" id="table_one"></table>
                </div>
                <!-- 状态变更记录 -->
                <div class="layui-tab-item">
                    <div class="icon-box layui-btn-containner">
                        <div class="export-icon icon"></div>
                        <div class="stamp-icon icon"></div>
                    </div>
                    <table class="layui-table" id="table_two"></table>
                </div>
                <!-- 相关文档 -->
                <div class="layui-tab-item">
                    <div class="icon-box layui-btn-containner">
                        <div class="export-icon icon"></div>
                        <div class="stamp-icon icon"></div>
                    </div>
                    <table class="layui-table" id="table_three"></table>
                </div>
                <!-- 关联备品备件 -->
                <div class="layui-tab-item">
                    <div class="icon-box layui-btn-containner">
                        <div class="export-icon icon"></div>
                        <div class="stamp-icon icon"></div>
                    </div>
                    <table class="layui-table" id="table_fore"></table>
                </div>
                <!-- 备品备件消耗记录 -->
                <div class="layui-tab-item">
                    <div class="icon-box layui-btn-containner">
                        <div class="export-icon icon"></div>
                        <div class="stamp-icon icon"></div>
                    </div>
                    <table class="layui-table" id="table_five"></table>
                </div>
                <!-- 信息变更记录 -->
                <div class="layui-tab-item">
                    <div class="icon-box layui-btn-containner">
                        <div class="export-icon icon"></div>
                        <div class="stamp-icon icon"></div>
                    </div>
                    <table class="layui-table" id="table_six"></table>
                </div>
                <!-- 设备履历 -->
                <div class="layui-tab-item">
                    <div class="icon-box layui-btn-containner">
                        <div class="export-icon icon"></div>
                        <div class="stamp-icon icon"></div>
                    </div>
                    <table class="layui-table" id="table_seven"></table>
                </div>
                <!-- Scada -->
                <div class="layui-tab-item">
                    <div class="icon-box layui-btn-containner">
                        <div class="export-icon icon"></div>
                        <div class="stamp-icon icon"></div>
                    </div>
                    <table class="layui-table" id="table_eight"></table>
                </div>
                <!-- 请采购记录 -->
                <div class="layui-tab-item">
                    <div class="icon-box layui-btn-containner">
                        <div class="export-icon icon"></div>
                        <div class="stamp-icon icon"></div>
                    </div>
                    <table class="layui-table" id="table_nine"></table>
                </div>
                <!-- 设备参数 -->
                <div class="layui-tab-item">
                    <div class="icon-box layui-btn-containner">
                        <div class="export-icon icon"></div>
                        <div class="stamp-icon icon"></div>
                    </div>
                    <table class="layui-table" id="table_ten"></table>
                </div>
            </div>
        </div>
    </div>
    <script type="text/html" id="list-one">
            <div class="layui-title">
                <div class="layui-title-inner">设备基本信息</div>
                <span class="icon stamp-icon layui-icon "></span>
                <span class="icon edit-icon"></span>
                <span class="icon export-icon"></span>
            </div>
            <ul class="box layui-row">
                <li class="layui-col-md3 layui-col-sm3">
                    <div>设备ID：{{ d.tcDevId }}</div>
                    <div>设备编号:{{ d.fia01 }}</div>
                    <div>设备状态： {{# if(d.fiaacti == 1){ }} 完成：{{ }} {{# } else { }} 未完成 {{# } }}
                    </div>
                    <div>所属公司：{{ d.azp02 }}</div>
                    <div>资产编号：{{ d.fia011 }}</div>
                </li>
                <li class="layui-col-md3 layui-col-sm3">
                    <div>设备名称：{{ d.fia02 }}</div>
                    <div>设备类型:{{ d.fic02 }}</div>
                    <div id="fia011" data-name="{{ d.fii02 }}">设备型号:{{ d.fii02 }}</div>
                    <div>设备系列:{{ d.tcSeriesName }}</div>
                    <div>供应商:{{ d.pmc081 }}</div>
                </li>
                <li class="layui-col-md3 layui-col-sm3">
                    <div>购买日期:{{ d.fia18.slice(0,10) }}</div>
                    <div>启动日期:{{ d.fia19.slice(0,10) }}</div>
                    <div>保修日期:{{ d.fia20.slice(0,10) }}</div>
                    <div>验收日期:{{ d.tcDevChkdate.slice(0,10) }}</div>
                </li>
                <li class="layui-col-md3 layui-col-sm3">
                    <div>设备图片</div>
                    {{# layui.each(d.paths, function(index, item){ }}
                    <img src="{{ d.host }}{{ item.tcFilePath }}" id="upload-img"> {{# }); }}
                </li>
            </ul>
            <div class="layui-fluid">
                <div class="layui-title">
                    <span class="layui-title-inner">设备位置及其相关部门.人员</span>
                    <span class="icon stamp-icon layui-icon"></span>
                    <span class="icon edit-icon"></span>
                    <span class="icon export-icon"></span>
                </div>
                <ul class="box layui-row">
                    <li class="layui-col-md3 layui-col-sm3">
                        <div>所在厂房：{{ d.tcFtyName }}</div>
                        <div>所在楼层：{{ d.tcFlrName }}</div>
                    </li>
                    <li class="layui-col-md3 layui-col-sm3">
                        <div>站别线别：{{ d.tcLineName }}</div>
                        <div>负责部门：{{ d.gem02 }}</div>
                    </li>
                    <li class="layui-col-md3 layui-col-sm3">
                        <div>保管人：{{ d.keeper }}</div>
                        <div>设备调机人员：{{ d.mover }}</div>
                    </li>
                </ul>
            </div>
            <div class="layui-fluid">
                <div class="layui-title">
                    <span class="layui-title-inner">设备说明
                            </span>
                    <span class="icon stamp-icon layui-icon "></span>
                    <span class="icon edit-icon"></span>
                    <span class="icon export-icon"></span>
                </div>
                <ul class="box layui-row">
                    <li class="layui-col-md3 layui-col-sm3">
                        <div>精度:{{ d.tcDevPrecision }}</div>
                        <div id="view-two"></div>
                        <div id="view-three"></div>
                    </li>
                    <li class="layui-col-md3 layui-col-sm3 layui-form">
                        <div>安全说明:</div>
                        <textarea name="desc" class="text layui-textarea" lay-verify="required">{{ d.fia25 }}</textarea>
                    </li>
                    <li class="layui-col-md3 layui-col-sm3 layui-form">
                        <div>备注:</div>
                        <textarea name="desc" class="text layui-textarea">{{ d.fia22 }}</textarea>
                    </li>
                </ul>
            </div>
            <div id='view-fore'></div>
            <div class="layui-fluid">
                <div class="layui-title">
                    <span class="layui-title-inner">Scada
                    </span>
                    <span class="icon stamp-icon layui-icon "></span>
                    <span class="icon edit-icon"></span>
                    <span class="icon export-icon"></span>
                </div>
                <ul class="box layui-row">
                    
                    <li class="layui-col-md3 layui-col-sm3">
                        {{#  if(d.tcScadaIsonine != null){ }}
                        {{#  if(d.tcScadaIsonine == 1){ }}
                        <div name='{{ d.tcScadaIsonine }}'>是否联机：是</div>
                        {{#  } else if((d.tcScadaIsonine == 0)) { }}
                        <div name='{{ d.tcScadaIsonine }}'>是否联机：否</div>
                        {{#  } }}  
                        {{#  } else { }}
                        <div>是否联机：</div>
                        {{#  } }}  
                        {{#  if(d.tcScadaDrvtype != null){ }}
                        <div>驱动类型：{{ d.tcScadaDrvtype }}</div>
                        {{#  } else { }}
                        <div>驱动类型：</div>
                        {{#  } }}  
                        {{#  if(d.tcScadaDrvname != null){ }}
                        <div>驱动名称：{{ d.tcScadaDrvname }}</div>
                        {{#  } else { }}
                        <div>驱动名称：</div>
                        {{#  } }} 
                        
                    </li>
                    <li class="layui-col-md3 layui-col-sm3">
                        {{#  if(d.tcScadaIpaddress != null){ }}
                        <div>设备IP：{{ d.tcScadaIpaddress }}</div>
                        {{#  } else { }}
                        <div>设备IP：</div>
                        {{#  } }} 
                        {{#  if(d.tcScadaProdtime != null){ }}
                        <div>正常生产时长：{{ d.tcScadaProdtime }}</div>
                        {{#  } else { }}
                        <div>正常生产时长：</div>
                        {{#  } }} 
                        {{#  if(d.tcScadaProdtime != null){ }}
                        <div>待机时长：{{ d.tcScadaStdbytime }}</div>
                        {{#  } else { }}
                        <div>待机时长：</div>
                        {{#  } }} 
                    </li>
                    <li class="layui-col-md3 layui-col-sm3">
                        {{#  if(d.tcScadaExcptime != null){ }}
                        <div>异常时长：{{ d.tcScadaExcptime }}</div>
                        {{#  } else { }}
                        <div>异常时长：</div>
                        {{#  } }} 
                        {{#  if(d.tcScadaMainttime != null){ }}
                        <div>维修保养时长：{{ d.tcScadaMainttime }}</div>
                        {{#  } else { }}
                        <div>维修保养时长：</div>
                        {{#  } }} 
                        {{#  if(d.tcScadaProduction != null){ }}
                        <div>产量：{{ d.tcScadaProduction }}</div>
                        {{#  } else { }}
                        <div>产量：</div>
                        {{#  } }} 
                    </li>
                </ul>
            </div>
        </script>

    <script type="text/html" id="list-fore">
            <div class="layui-fluid">
                <div class="layui-title">
                    <span class="layui-title-inner">相关参数
                    </span>
                    <span class="icon stamp-icon layui-icon "></span>
                    <span class="icon edit-icon"></span>
                    <span class="icon export-icon"></span>
                </div>
                <ul class="box layui-row">
                    {{# layui.each(d, function(index, item){ }}
                    <li class="layui-col-md3 layui-col-sm3">
                        <div>{{ this.tcParName }}: {{ this.tcParValue }} {{ this.tcParUnit }}</div>
                    </li>
                    {{# }); }}
                </ul>
            </div>
    </script>
    <script type="text/html" id="typeTpl">
            {{#  if(d.fil04 == 'WX' ){ }}
            <div>设备维修工单</div>
            {{#  } else if(d.type == 'BY' ) { }}
            <div>设备保养工单</div>
            {{#  } else if(d.fil04 == 'XJ' ) { }}
            <div>设备巡检计划</div>
            {{#  } else if(d.fil04 == 'DB' ) { }}
            <div>设备调拨工单</div>
            {{#  } else if(d.fil04 == 'BF' ) { }}
            <div>设备报废工单</div>
            {{#  } else if(d.fil04 == 'TY' ) { }}
            <div>设备停用工单</div>
            {{#  } else if(d.fil04 == 'QY' ) { }}
            <div>设备启用工单</div>
            {{#  } else if(d.fil04 == 'BG' ) { }}
            <div>设备信息变更工单</div>
            {{#  } else if(d.fil04 == 'SP' ) { }}
            <div>备品备件借调工单</div>
            {{#  } else if(d.fil04 == 'PD' ) { }}
            <div>设备盘点</div>
            {{#  } }}
        </script>
    <script type="text/html" id="typeTpl_one">
            {{#  if(d.fil05 == 0 ){ }}
            <div>创建/未提交</div>
            {{#  } else if(d.fil05 == 1 ) { }}
            <div>待审核(已提交)</div>
            {{#  } else if(d.fil05 == 2 ) { }}
            <div>待执行(已派单)/未完成</div>
            {{#  } else if(d.fil05 == 3 ) { }}
            <div>外修(维修工单)</div>
            {{#  } else if(d.fil05 == 4 ) { }}
            <div>待确认</div>
            {{#  } else if(d.fil05 == 5 ) { }}
            <div>待领料</div>
            {{#  } else if(d.fil05 == 6 ) { }}
            <div>OA送审中</div>
            {{#  } else if(d.fil05 == 9 ) { }}
            <div>归档/已盘点</div>
            {{#  } }}
        </script>
    <script type="text/html" id="list-two">
            {{#  layui.each(d, function(index, item){ }}
                <div>机台能力：{{ item.tcCapName }}</div>
            {{#  }); }}
        </script>
    <script type="text/html" id="list-three">
            {{#  layui.each(d, function(index,item){ }}
                <div>生产能力：{{ item.tcProdName }}</div>
            {{#  }); }}
        </script>
    <script type="text/html" id="down">
                <a href="{{ d.host }}{{d.tcEamFile.tcFileUrl}}" download id="download"></a>
        </script>
    <script>
        layui.use(['table', 'admin', 'laypage', 'jquery', 'laytpl', 'tree', 'form', 'api', 'view', 'laydate', 'setter', 'treeSelect', 'element'], function () {
            var table = layui.table;
            var admin = layui.admin;
            var laypage = layui.laypage;
            var $ = layui.jquery;
            var laytpl = layui.laytpl;
            var tree = layui.tree;
            var form = layui.form;
            var api = layui.api;
            var view = layui.view;
            var laydate = layui.laydate;
            var setter = layui.setter;
            var treeSelect = layui.treeSelect;
            var element = layui.element;
            var router = layui.router();

            var id = router.search.id;
            var str = sessionStorage.getItem('ipay-merchant')
            var token = JSON.parse(str).token;
            form.render();
            var h = window.location.hash;
            var id = Number(h.substring(32));
            var oid = {
                id: id
            };
            var fia01 = '';
            $('[data-jump="home/balance"]').addClass('layui-this').attr('color', '#FFF');
            $('#view-one').on('click', '.edit-icon', function () {
                var url = "/home/branch-one/detailed-edit#/?id=" + id;
                $('.edit-icon').attr('lay-href', url);
            })

            //状态变更记录
            render_two(id);
            render_six(id);
            // render_nine(id);
            admin.req({
                type: 'get',
                url: api.host + api.xxxx.views_one,
                dataType: 'json',
                contentType: "application/json",
                data: { id },
                success: function (data) {
                    //请求成功时处理
                    var data = data.data;
                    var str = api.host;
                    data.host = str.slice(0, 26);
                    var fia011 = data.fii02;
                    render_one(data.fia01);
                    render_three(data.tcModelId);
                    render_seven(data.fia01);
                    render_five(data.fia01);
                    render_ten(data.fia011);
                    admin.req({
                        url: api.host + api.xxxx.views_fore,
                        type: 'post',
                        dataType: 'json',
                        contentType: 'application/json',
                        data: JSON.stringify({ fia011, pageNum: 0, pageSize: 0 }),
                        success: function (data) {
                            var data = data.data.list;
                            if (data != '') {
                                laytpl($('#list-fore').html()).render(data, function (html) {
                                    $('#view-fore').html(html)
                                });
                            } else {
                                $('#list-fore').attr('display', 'none');
                                $('#view-fore').attr('display', 'none')
                            }

                        },
                    });
                    laytpl($('#list-one').html()).render(data, function (html) {
                        $('#view-one').html(html)
                    });
                },
            });
            admin.req({
                url: api.host + api.xxxx.views_two,
                type: 'get',
                dataType: 'json',
                contentType: "application/json",
                data: { id },
                success: function (data) {
                    //请求成功时处理
                    var data = data.data;
                    laytpl($('#list-two').html()).render(data, function (html) {
                        $('#view-two').html(html);
                    });
                    element.render();
                },

            });
            admin.req({
                url: api.host + api.xxxx.views_three,
                type: 'get',
                dataType: 'json',
                contentType: 'application/json',
                data: { id },
                success: function (data) {
                    //请求成功时处理
                    var data = data.data;
                    laytpl($('#list-three').html()).render(data, function (html) {
                        $('#view-three').html(html)
                    });
                    element.render();
                },
            });


            //相关工单
            function render_one(data) {
                table.render({
                    elem: '#table_one',
                    skin: 'nob',
                    align: 'center',
                    method: 'post',
                    dataType: 'json',
                    where: {
                        fia01: data
                    },
                    url: api.host + api.xbxq.table1 //数据接口
                    ,
                    contentType: 'application/json',
                    page: {
                        count: 50,
                        limit: 10,
                        layout: ['prev', 'page', 'next', 'skip']
                    },
                    request: {
                        pageName: 'pageNum' //页码的参数名称，默认：page
                        ,
                        limitName: 'pageSize' //每页数据量的参数名，默认：limit
                    },
                    response: {
                        statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
                    },
                    parseData: function (res) { //res 即为原始返回的数据
                        return {
                            "code": 200, //解析接口状态
                            "msg": res.message, //解析提示文本
                            "data": res.data.list //解析数据列表
                        };
                    },
                    headers: { 'token': layui.sessionData(setter.tableName).token },
                    cols: [
                        [{
                            type: 'checkbox',
                            align: 'center'
                        }, {
                            type: 'numbers',
                            title: '序号',
                            align: 'center'
                        }, {
                            field: 'fil04',
                            title: '类型',
                            align: 'center',
                            templet: '#typeTpl'
                        }, {
                            field: 'fil05',
                            title: '状态',
                            align: 'center',
                            templet: '#typeTpl_one'
                        }, {
                            field: 'tcBugName',
                            title: '故障类型',
                            align: 'center'
                        }, {
                            field: 'fil12',
                            title: '工单发生时间',
                            align: 'center',
                        }, {
                            field: 'fil151',
                            title: '工单结案时间',
                            align: 'center'
                        }, {
                            field: 'TcReqDuration',
                            title: '停机时长',
                            align: 'center'
                        }, {
                            field: 'xjgen02',
                            title: '报修人',
                            align: 'center'
                        }]
                    ],
                    done: function (res, curr, count) {
                        $("table").css("width", "100%");
                    },
                });
            }

            //状态变更记录
            function render_two(data) {
                table.render({
                    elem: '#table_two',
                    skin: 'nob',
                    align: 'center',
                    method: 'post',
                    where: {
                        fia011: data
                    },
                    url: api.host + api.xbxq.table2 //数据接口
                    ,
                    contentType: 'application/json',
                    page: {
                        count: 50,
                        limit: 10,
                        layout: ['prev', 'page', 'next', 'skip']
                    },
                    request: {
                        pageName: 'pageNum' //页码的参数名称，默认：page
                        ,
                        limitName: 'pageSize' //每页数据量的参数名，默认：limit
                    },
                    response: {
                        statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
                    },
                    parseData: function (res) { //res 即为原始返回的数据
                        return {
                            "code": 200, //解析接口状态
                            "msg": res.message, //解析提示文本
                            "data": res.data.statChgLog.list //解析数据列表
                        };
                    },
                    headers: { 'token': layui.sessionData(setter.tableName).token },
                    cols: [
                        [{
                            type: 'checkbox',
                            align: 'center'
                        }, {
                            type: 'numbers',
                            title: '序号',
                            align: 'center'
                        }, {
                            field: 'tcLogId',
                            title: '设备状态变更记录ID',
                            align: 'center'
                        }, {
                            field: 'tcLogTime',
                            title: '变更时间',
                            align: 'center'
                        }, {
                            field: 'tcLogStatorig',
                            title: '变更前状态',
                            align: 'center'
                        }, {
                            field: 'tcLogStatalt',
                            title: '变更后状态',
                            align: 'center'
                        }, {
                            field: 'gen02',
                            title: '操作人',
                            align: 'center'
                        }, {
                            field: 'tcLogModby',
                            title: '操作者工号',
                            align: 'center'
                        }]
                    ],
                    done: function (res, curr, count) {
                        $("table").css("width", "100%");
                    },
                });
            }
            //相关文档
            function render_three(data) {
                admin.req({
                    url: api.host + api.xbxq.table3,
                    type: 'post',
                    dataType: 'json',
                    contentType: 'application/json',
                    data: JSON.stringify({
                        modelid: data,
                        pageNum: 1,
                        pageSize: 10
                    }),
                    success: function (data) {
                        var str = api.host;
                        var data = data.data.list;
                        data.forEach(data => {
                            data.host = data.host = str.slice(0, 26);
                        }),
                            table.render({
                                elem: '#table_three',
                                data: data,
                                skin: 'nob',
                                align: 'center',
                                page: {
                                    count: 50,
                                    limit: 10,
                                    layout: ['prev', 'page', 'next', 'skip']
                                },
                                cols: [
                                    [{
                                        type: 'checkbox',
                                        align: 'center'
                                    }, {
                                        type: 'numbers',
                                        title: '序号',
                                        align: 'center'
                                    }, {
                                        field: 'tcDocName',
                                        title: '文档名称',
                                        align: 'center'
                                    }, {
                                        field: 'tcEamFile',
                                        title: '文档分类',
                                        align: 'center',
                                        templet: '<div>{{d.tcEamFile.tcFileType}}</div>'
                                    }, {
                                        field: 'tcDocCatgName',
                                        title: '文档类型',
                                        align: 'center',
                                    }, {
                                        field: 'list',
                                        title: '操作',
                                        align: 'center',
                                        templet: '#down'
                                    }]
                                ],
                                done: function (res, curr, count) {
                                    $("table").css("width", "100%");
                                },
                            });
                    },
                });

            }
            //备品备件消耗记录
            function render_five(data) {
                table.render({
                    elem: '#table_five',
                    skin: 'nob',
                    align: 'center',
                    method: 'post',
                    where: { tcDetailFia01: data },
                    url: api.host + api.xbxq.table5 //数据接口
                    ,
                    contentType: 'application/json',
                    page: {
                        count: 50,
                        limit: 10,
                        layout: ['prev', 'page', 'next', 'skip']
                    },
                    request: {
                        pageName: 'pageNum' //页码的参数名称，默认：page
                        ,
                        limitName: 'pageSize' //每页数据量的参数名，默认：limit
                    },
                    response: {
                        statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
                    },
                    parseData: function (res) { //res 即为原始返回的数据
                        return {
                            "code": 200, //解析接口状态
                            "msg": res.message, //解析提示文本
                            "data": res.data.list //解析数据列表
                        };
                    },
                    headers: { 'token': layui.sessionData(setter.tableName).token },
                    cols: [
                        [{
                            type: 'checkbox',
                            align: 'center'
                        }, {
                            type: 'numbers',
                            title: '序号',
                            align: 'center'
                        }, {
                            field: 'fiv02',
                            title: '相关工单编号',
                            align: 'center'
                        }, {
                            field: 'fiw03',
                            title: '备品备件料件编号',
                            align: 'center'
                        }, {
                            field: 'fiv07',
                            title: '备品备件OA申请人',
                            align: 'center'
                        }, {
                            field: 'gen02',
                            title: '申请人名称',
                            align: 'center'
                        }, {
                            field: 'fim01',
                            title: '相关工单',
                            align: 'center'
                        }, {
                            field: 'fil10',
                            title: '申请时间',
                            align: 'center'
                        }, {
                            field: 'fiw08',
                            title: '数量',
                            align: 'center'
                        }]
                    ],
                    done: function (res, curr, count) {
                        $("table").css("width", "100%");
                    },
                });
            }


            //设备信息变更记录
            function render_six(data) {
                table.render({
                    elem: '#table_six',
                    skin: 'nob',
                    align: 'center',
                    method: 'post',
                    where: { fia011: data },
                    url: api.host + api.xbxq.table6 //数据接口
                    ,
                    contentType: 'application/json',
                    page: {
                        count: 50,
                        limit: 10,
                        layout: ['prev', 'page', 'next', 'skip']
                    },
                    request: {
                        pageName: 'pageNum' //页码的参数名称，默认：page
                        ,
                        limitName: 'pageSize' //每页数据量的参数名，默认：limit
                    },
                    response: {
                        statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
                    },
                    parseData: function (res) { //res 即为原始返回的数据
                        return {
                            "code": 200, //解析接口状态
                            "msg": res.message, //解析提示文本
                            "data": res.data.infoChgLog.list //解析数据列表
                        };
                    },
                    headers: { 'token': layui.sessionData(setter.tableName).token },
                    cols: [
                        [{
                            type: 'checkbox',
                            align: 'center'
                        }, {
                            type: 'numbers',
                            title: '序号',
                            align: 'center'
                        }, {
                            field: 'tcLogId',
                            title: '设备状态变更记录ID',
                            align: 'center'
                        }, {
                            field: 'tcLogTime',
                            title: '变更时间',
                            align: 'center'
                        }, {
                            field: 'tcLogInfoalt',
                            title: '变更前状态',
                            align: 'center'
                        }, {
                            field: 'tcLogInfoalt',
                            title: '变更后状态',
                            align: 'center'
                        }, {
                            field: 'gen02',
                            title: '操作人',
                            align: 'center'
                        }, {
                            field: 'tcLogModby',
                            title: '操作者工号',
                            align: 'center'
                        }]
                    ],
                    done: function (res, curr, count) {
                        $("table").css("width", "100%");
                    },
                });
            }
            //设备履历
            function render_seven(data) {
                table.render({
                    elem: '#table_seven',
                    skin: 'nob',
                    align: 'center',
                    method: 'post',
                    url: api.host + api.xbxq.table7 //数据接口
                    ,
                    where: {
                        tcDetailFia01: data
                    },
                    dataType: 'json',
                    contentType: 'application/json',
                    page: {
                        count: 50,
                        limit: 10,
                        layout: ['prev', 'page', 'next', 'skip']
                    },
                    request: {
                        pageName: 'pageNum' //页码的参数名称，默认：page
                        ,
                        limitName: 'pageSize' //每页数据量的参数名，默认：limit
                    },
                    response: {
                        statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
                    },
                    parseData: function (res) { //res 即为原始返回的数据
                        return {
                            "code": 200, //解析接口状态
                            "msg": res.message, //解析提示文本
                            "data": res.data.list //解析数据列表
                        };
                    },
                    headers: { 'token': layui.sessionData(setter.tableName).token },
                    cols: [
                        [{
                            type: 'checkbox',
                            align: 'center'
                        }, {
                            type: 'numbers',
                            title: '序号',
                            align: 'center'
                        }, {
                            field: 'azp02',
                            title: '原公司',
                            align: 'center'
                        }, {
                            field: 'azp021',
                            title: '新公司',
                            align: 'center'
                        }, {
                            field: 'fim01',
                            title: '相关工单',
                            align: 'center'
                        }, {
                            field: 'gen02',
                            title: '申请人',
                            align: 'center'
                        }]
                    ],
                    // done: function(res, curr, count) {
                    //     $("table").css("width", "100%");
                    // },
                });
            }
            //请采购记录
            function render_nine(data) {
                table.render({
                    elem: '#table_nine',
                    skin: 'nob',
                    align: 'center',
                    method: 'post',
                    where: { tcDevId: data },
                    url: api.host + api.xbxq.table9 //数据接口
                    ,
                    contentType: 'application/json',
                    page: {
                        count: 50,
                        limit: 10,
                        layout: ['prev', 'page', 'next', 'skip']
                    },
                    request: {
                        pageName: 'pageNum' //页码的参数名称，默认：page
                        ,
                        limitName: 'pageSize' //每页数据量的参数名，默认：limit
                    },
                    response: {
                        statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
                    },
                    parseData: function (res) { //res 即为原始返回的数据
                        return {
                            "code": 200, //解析接口状态
                            "msg": res.message, //解析提示文本
                            "data": res.data.list //解析数据列表
                        };
                    },
                    headers: { 'token': layui.sessionData(setter.tableName).token },
                    cols: [
                        [{
                            type: 'checkbox',
                            align: 'center'
                        }, {
                            type: 'numbers',
                            title: '序号',
                            align: 'center'
                        }, {
                            field: 'pmm01',
                            title: '采购单号',
                            align: 'center'
                        }, {
                            field: 'pmm04',
                            title: '采购日期',
                            align: 'center'
                        }, {
                            field: 'pmm12',
                            title: '采购员',
                            align: 'center'
                        }, {
                            field: 'pmn20',
                            title: '采购量',
                            align: 'center'
                        }, {
                            field: 'pmn34',
                            title: '到厂日期',
                            align: 'center'
                        }, {
                            field: 'pmn35',
                            title: '到库日期',
                            align: 'center'
                        }]
                    ],
                    done: function (res, curr, count) {
                        $("table").css("width", "100%");
                    },
                });
            }
            //设备参数
            function render_ten(data) {
                table.render({
                    elem: '#table_ten',
                    method: 'post',
                    url: api.host + api.xbxq.table10 //数据接口
                    ,
                    where: {
                        fia011: data
                    },
                    skin: 'nob',
                    align: 'center',
                    dataType: 'json',
                    contentType: 'application/json',
                    page: {
                        count: 50,
                        limit: 10,
                        layout: ['prev', 'page', 'next', 'skip']
                    },
                    request: {
                        pageName: 'pageNum' //页码的参数名称，默认：page
                        ,
                        limitName: 'pageSize' //每页数据量的参数名，默认：limit
                    },
                    response: {
                        statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
                    },
                    parseData: function (res) { //res 即为原始返回的数据
                        return {
                            "code": 200, //解析接口状态
                            "msg": res.message, //解析提示文本
                            "data": res.data.list //解析数据列表
                        };
                    },
                    headers: { 'token': layui.sessionData(setter.tableName).token },
                    cols: [
                        [{
                            type: 'checkbox',
                            align: 'center'
                        }, {
                            type: 'tcParId',
                            title: '序号',
                            align: 'center'
                        }, {
                            field: 'tcParName',
                            title: '参数名称',
                            align: 'center'
                        }, {
                            field: 'tcParUnit',
                            title: '参数单位',
                            align: 'center'
                        }, {
                            field: 'tcParValue',
                            title: '参数值',
                            align: 'center'
                        }]
                    ],
                    done: function (res, curr, count) {
                        $("table").css("width", "100%");
                    },
                });
            }


        });
    </script>